import 'xmm_error_type.dart';

class XmmHttpException extends XmmErrorException {
  XmmHttpException(this.errorType, [this.errorMessage, String? message])
      : super(message);

  XmmErrorType errorType;
  String? errorMessage;

  @override
  String toString() {
    return "HttpException(errorType:$errorType, errorMessage:$errorMessage, message:$message)";
  }
}

class XmmBusinessException extends XmmErrorException {
  XmmBusinessException(this.errorCode, {String? message, this.data})
      : super(message);

  int errorCode;
  dynamic data;

  @override
  String toString() {
    return "BusinessException(errorCode:$errorCode, message:$message, data:$data)";
  }
}

class XmmErrorException {
  XmmErrorException(this.message);

  String? message;

  @override
  String toString() {
    return "ErrorException(message:$message)";
  }
}
